package cn.huijielong.modules.group.entity;

import java.io.Serializable;
import java.util.Comparator;
import java.util.Date;
import java.math.BigDecimal;


/**
 * 订单商品项
 * 
 * @author xys
 * @email xys@gmail.com
 * @date 2019-07-03 22:46:43
 */
public class OrderItemEntity implements Serializable,Comparator<OrderItemEntity> {
	private static final long serialVersionUID = 1L;
	
	private Long orderItemId;
	//
	private Long orderId;
	//
	private String orderNo;
	//
	private Long goodsId;
	//
	private Integer buyNum;
	//
	private BigDecimal payAmount;
	//
	private String goodsName;
	//
	private String headImg;

	/**
	 * 设置：
	 */
	public void setOrderId(Long orderId) {
		this.orderId = orderId;
	}
	/**
	 * 获取：
	 */
	public Long getOrderId() {
		return orderId;
	}
	/**
	 * 设置：
	 */
	public void setOrderNo(String orderNo) {
		this.orderNo = orderNo;
	}
	/**
	 * 获取：
	 */
	public String getOrderNo() {
		return orderNo;
	}
	/**
	 * 设置：
	 */
	public void setGoodsId(Long goodsId) {
		this.goodsId = goodsId;
	}
	/**
	 * 获取：
	 */
	public Long getGoodsId() {
		return goodsId;
	}
	/**
	 * 设置：
	 */
	public void setBuyNum(Integer buyNum) {
		this.buyNum = buyNum;
	}
	/**
	 * 获取：
	 */
	public Integer getBuyNum() {
		return buyNum;
	}
	/**
	 * 设置：
	 */
	public void setPayAmount(BigDecimal payAmount) {
		this.payAmount = payAmount;
	}
	/**
	 * 获取：
	 */
	public BigDecimal getPayAmount() {
		return payAmount;
	}
	public String getGoodsName() {
		return goodsName;
	}
	public void setGoodsName(String goodsName) {
		this.goodsName = goodsName;
	}
	public Long getOrderItemId() {
		return orderItemId;
	}
	public void setOrderItemId(Long orderItemId) {
		this.orderItemId = orderItemId;
	}
	
	public String getHeadImg() {
		return headImg;
	}
	public void setHeadImg(String headImg) {
		this.headImg = headImg;
	}
	@Override
	public int compare(OrderItemEntity o1, OrderItemEntity o2) {
		Long id1=o1.orderItemId;
		Long id2=o2.orderItemId;
		if(id1==null || id2==null) {
			if(id1==null)
				return -1;
			else
				return 1;
		}else {
			if(id1<id2)
				return -1;
			else if(id1>id2)
				return 1;
			else
				return 0;
		}
	}
	
}
